<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<style>

#cdiTable thead tr td{
	font-size: 16px;
	border-color: blue;
	background-color: yellow;
	padding:4px;
	color: blue;	
}

#sumTr td{
	color: black;	
}
</style>

<c:if test="${showReport != null }">

<div >

<h2>客訴案件數管報及列表統計</h2>

<p>
搜尋條件: <br>
期間  = ${startDate } ~ ${endDate }<br>
案件類別  = ${typeMap[caseType]}<br>
客訴階段 = ${stepName}<br>
</p>

 
<table border="1" id="cdiTable" class="tablesorter"  style="width: 600px;">

	<thead>
	<tr>
		<td rowspan="2">廠區\階段</td>
		<td colspan="3">${stepName}</td>
	</tr>
	<tr>
		<td>執行中</td>	
		<td>逾期</td>	
		<td>合計</td>
	</tr>
	
</thead>
	
	<tbody>
	
	<c:if test="${empty reportMap}">
		<tr>
     		<td colspan="4" >查無客訴資料</td>
     	</tr>
	</c:if>
	
	<c:forEach var="r" items="${reportMap}">
	<tr>
     <td>
     	${madeinMap[r.key]}
     </td>
     <td>
     	<a href="<c:url value="/report08/0804-1/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&madeIn=${r.key}&step=${status.index+1 }" />">${r.value[0]}</a>
     </td>
     <td>
     	---
     </td>
     <td>
     	<a href="<c:url value="/report08/0804-1/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&madeIn=${r.key}&step=${status.index+1 }" />">${r.value[2]}</a>     	
     </td>
	</tr>	
	</c:forEach>	
	
	</tbody>
	
	<tr id="sumTr">	
	<td>總計</td>
	<c:forEach var="sum" items="${sumSteps}">   
     	<td>
     		<a href="<c:url value="/report08/0804-3/find.do?startDate=${startDate}&endDate=${endDate}&caseType=${caseType}&step=${status.index+1 }" />">${sum}</a>
     	</td>	
	</c:forEach>
	</tr>	
	
	
</table>

</div>

</c:if>

<script>
$(function() {
	$("#cdiTable").tablesorter({
		widgets: ['zebra']
		}); 
})

</script>
